/* 文章列表页面样式 */

/* 头部导航 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background-color: var(--white-color);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--light-gray);
}

.back-btn {
    font-size: 22px;
    color: var(--text-color);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-title {
    font-size: 17px;
    font-weight: 600;
    flex: 1;
    text-align: center;
    margin: 0;
}

.action-btns {
    display: flex;
    align-items: center;
    font-size: 20px;
    color: var(--text-color);
}

.action-btns i {
    margin-left: 15px;
    cursor: pointer;
}

/* 分类标签 */
.category-tabs {
    position: sticky;
    top: 50px;
    z-index: 9;
    background-color: var(--white-color);
    padding: 10px 0;
    border-bottom: 1px solid var(--light-gray);
}

.tabs-container {
    display: flex;
    overflow-x: auto;
    padding: 0 15px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.tabs-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.tab {
    padding: 8px 15px;
    margin-right: 10px;
    border-radius: 15px;
    font-size: 14px;
    white-space: nowrap;
    color: var(--gray-color);
    background-color: var(--light-gray);
    cursor: pointer;
    transition: all 0.3s;
}

.tab.active {
    background-color: var(--primary-color);
    color: var(--white-color);
}

/* 推荐文章 */
.featured-articles {
    padding: 15px;
    margin-bottom: 15px;
}

.featured-article {
    background-color: var(--white-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.featured-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.featured-content {
    padding: 15px;
}

.featured-content h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--text-color);
}

.featured-content p {
    font-size: 14px;
    color: var(--gray-color);
    margin-bottom: 15px;
    line-height: 1.5;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.author-info {
    display: flex;
    align-items: center;
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
}

.author-info span {
    font-size: 13px;
    color: var(--gray-color);
}

.meta-data {
    font-size: 12px;
    color: var(--gray-color);
}

.meta-data span {
    margin-left: 10px;
}

.meta-data i {
    margin-right: 3px;
}

/* 文章列表 */
.article-list-section {
    padding: 0 15px 80px; /* 底部留出空间给导航栏 */
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.article-item {
    display: flex;
    background: var(--white-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-item:hover, .article-item:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-img {
    flex: 0 0 110px;
    height: 100px;
}

.article-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.article-content h3 {
    font-size: 15px;
    font-weight: 500;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-color);
}

.article-desc {
    font-size: 13px;
    color: var(--gray-color);
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--gray-color);
}

.publish-time {
    font-size: 12px;
    color: var(--gray-color);
}

/* 加载更多 */
.load-more {
    margin: 25px 0;
    display: flex;
    justify-content: center;
}

.load-more-btn {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.load-more-btn:hover {
    background-color: rgba(63, 81, 181, 0.1);
}

/* 为iPhone 15进行适配 */
@media screen and (width: 390px) and (height: 844px) {
    .header {
        padding-top: calc(15px + var(--iphone-safe-area-top));
    }
    
    .category-tabs {
        top: calc(50px + var(--iphone-safe-area-top));
    }
    
    .featured-content h2 {
        font-size: 17px;
    }
    
    .article-content h3 {
        font-size: 14px;
    }
    
    .article-desc {
        font-size: 12px;
    }
}

/* 小屏设备适配 */
@media (max-width: 320px) {
    .tab {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .featured-img {
        height: 140px;
    }
    
    .featured-content h2 {
        font-size: 16px;
    }
    
    .article-img {
        flex: 0 0 90px;
    }
    
    .article-content h3 {
        font-size: 13px;
    }
    
    .article-desc {
        font-size: 12px;
    }
    
    .author-avatar {
        width: 20px;
        height: 20px;
    }
}

/* 暗黑模式支持 */
@media (prefers-color-scheme: dark) {
    .tab {
        background-color: #333;
    }
    
    .tab.active {
        background-color: var(--primary-color);
    }
    
    .featured-content h2, .article-content h3 {
        color: #e0e0e0;
    }
    
    .featured-content p, .article-desc, .author-info span, .meta-data, .publish-time {
        color: #aaa;
    }
    
    .load-more-btn {
        background-color: transparent;
        border-color: var(--primary-color);
    }
    
    .load-more-btn:hover {
        background-color: rgba(63, 81, 181, 0.2);
    }
} 